package com.shuql.cloud.oauth2.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @author ：shuquanliang
 * @date ：Created in 2020/4/23 16:53
 * @description：
 */
@Controller
public class MainController {

    @Autowired
    private OAuth2RestTemplate restTemplate;

    @GetMapping("/")
    public String index() {
        return "index";
    }

    @GetMapping("/member")
    public String member() {
        //List<String> forObject = restTemplate.getForObject("http://localhost:8080/product/list", List.class);
        //List<String> forObject = restTemplate.getForObject("http://localhost:7001/product/list", List.class);
        //System.out.println("forObject:" + forObject);
        return "member";
    }

}
